package cn.easybuy.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

@Data
public class Order implements Serializable {

    @TableId(type = IdType.AUTO)
    private Integer id;//ID
    private String serialNumber;//订单号
    private Integer userId;//用户id
    private String userAddress;//收货地址
    private Date createTime;//创建时间
    private Float cost;//订单总计价格
    private String loginName;//登录名称

    @TableField(exist = false)
    private List<OrderDetail> orderDetailList;//订单明细列表

    @Override
    public int hashCode() {
        return id;
    }

    @Override
    public boolean equals(Object obj) {
        if(obj instanceof Order){
            if(((Order)obj).id==id){
                return true;
            }
        }
        return false;
    }

}
